module teapo.app.storage.pluggable { export class LocalStorageImplementation implements Storage { private _editedKey: string;
private _documentNamesKey: string;
private _documentNames: string[] = null;
globalProperties: PropertyAccess;
private _uniqueKey: string,
populate: { edited: Date }) { this._editedKey = this._uniqueKey + '*edited';
this._documentNamesKey = this._uniqueKey + '*documentNames';
var edited = this._localStorage[this._editedKey];
populate.edited = edited ? new Date(parseInt(edited)) : null;
documentNames(callback: (error: Error, names: string[]) => void) { if (!this._documentNames) { var documentNamesStr = this._localStorage[this._documentNamesKey];
if (typeof documentNamesStr !== 'string')
this._documentNames = [];
this._documentNames = documentNamesStr.split('\n'); callback(null, this._documentNames);
getDocument(fullPath: string, callback: (error: Error, docState: DocumentState) => void) { removeDocument(fullPath: string, callback: (error: Error) => void) { createDocument(fullPath: string, callback: (error: Error, docState: DocumentState) => void) { loadSecondary(storage: Storage) {